import request from '../../utils/request'
export function login(data) {
    return request({
        url: '/uum-admin/api/v2/login/adminLogin',
        method: 'post',
        headers: {
            'Authorization': 'Basic Y2xpZW50OjEyMzQ1Ng==' // 客户端信息加密，明文：client:123456
        },
        data
    })
}
export function checkName(username) {
    return request({
        url: '/uum-admin/api/v2/users/checkName/' + username,
        method: 'get'
    })
}

export function getUserInfo() {
    return request({
        url: '/uum-admin/api/v1/users/getUserInfo',
        method: 'get'
    })
}

export function getUserList(queryParams) {
    return request({
        url: '/uum-admin/api/v1/users/page',
        method: 'get',
        params: queryParams
    })
}

export function userDetail(id) {
    return request({
        url: '/uum-admin/api/v1/users/detail',
        method: 'get',
        params: { id }
    })
}

export function updateUser(data) {
    return request({
        url: '/uum-admin/api/v1/users/update',
        method: 'put',
        data
    })
}

export function disabledStatus(status,id) {
    return request({
        url: '/uum-admin/api/v1/users/disabled',
        method: 'put',
        params: {status,id}
    })
}


export function completeDelete(ids) {
    return request({
        url: '/uum-admin/api/v1/users/delete/'+ ids,
        method: 'delete',
    })
}

export function addUser(data) {
    return request({
        url: '/uum-admin/api/v1/users/add',
        method: 'post',
        data
    })
}

export function logout() {
    return request({
        url: '/uum-auth/oauth/logout',
        method: 'delete',
    })
}

